#include <stdio.h>
void fun(int x){
	int a,b,c;
	a=x/100;
	b=(x-a*100)/10;
	c=x%10;
	if(x==a*a*a+b*b*b+c*c*c)
	printf("%d\n",x);
}
int main(){
	int i,j;
	for(i=100;i<=999;i++){
		fun(i);
	}
}
